/**
 * 作为师傅出诊的时间段
 * 1、将数字转为时间
 * 2、将时间转为数字
 * **/
// 1、将数字转为时间
export function outCallTime(value) {
  if (value === 1) {
    return '08:30~12:00'
  }
  return '14:00~18:00'
}
// 2、将时间转为数字
export function timeToNum(value) {
  if (value === '08:30~12:00') {
    return 1
  }
  return 2
}
// 3、将数字转为性别
export function getGender(num) {
  if (num === 1) {
    return '男'
  } else {
    return '女'
  }
}
// 4.将数字转为星期
export function numToWeek(num){
  if(num === 1 || num === '1' || num === '一'){
    return '星期一'
  }else if(num === 2 || num === '2' || num === '二'){
    return '星期二'
  }else if(num === 3 || num === '3' || num === '三'){
    return '星期三'
  }else if(num === 4 || num === '4' || num === '四'){
    return '星期四'
  }else if(num === 5 || num === '5' || num === '五'){
    return '星期五'
  }else if(num === 6 || num === '6' || num === '六'){
    return '星期六'
  }else if(num === 7 || num === '7' || num === '日'){
    return '星期日'
  }
}
// 5.将数字转为大写
export function numToWord(num){
  if(num === 1 || num === '1' ){
    return '一'
  }else if(num === 2 || num === '2'){
    return '二'
  }else if(num === 3 || num === '3'){
    return '三'
  }else if(num === 4 || num === '4'){
    return '四'
  }else if(num === 5 || num === '5'){
    return '五'
  }else if(num === 6 || num === '6'){
    return '六'
  }else if(num === 7 || num === '7'){
    return '日'
  }
}
// 6.将大写转换为数字
export function wordToNum(word){
  if(word === '一'){
    return 1
  }else if(word === '二'){
    return 2
  }else if(word === '三'){
    return 3
  }else if(word === '四'){
    return 4
  }else if(word === '五'){
    return 5
  }else if(word === '六'){
    return 6
  }else if(word === '日'){
    return 7
  }
}
// 7.将Date转换为时间
export function DateToTime(date,status){
    console.log('date:  '+date)
    if(status === 'hour') {
    const hour = turnDouble(date.getHours());
    const minutes = turnDouble(date.getMinutes());
    return hour + ':' + minutes
  }
}
// 将获取到的时间假如不是两位数的话在前面加0
export function turnDouble(num) {
  // 假如长度为2
  if (num >= 10) {
    return num
  } else { // 否则在前面加0
    return '0' + num
  }
}
export function getDay(day) {
  switch (day) {
    case 0:
      return '日';
    case 1:
      return '一';
    case 2:
      return '二';
    case 3:
      return '三';
    case 4:
      return '四';
    case 5:
      return '五';
    case 6:
      return '六';
  }
}
